<!DOCTYPE html>
<html class="x-admin-sm">

<head>
  <meta charset="UTF-8">
  <title></title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport"
    content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
  <link rel="stylesheet" href="./css/font.css">
  <link rel="stylesheet" href="./css/xadmin.css">
  <link rel="stylesheet" href="./lib/layui/css/layui.css">
  <link rel="stylesheet" href="./css/link.css">

  <script type="text/javascript" src="./js/xadmin.js"></script>
  <!--[if lt IE 9]>
          <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
          <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
        <![endif]-->
</head>


<body>
  <div class="x-nav">
    <span class="layui-breadcrumb">
      <a href="">首页</a>
      <a href="">演示</a>
      <a>
        <cite>导航元素</cite></a>
    </span>
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right"
      onclick="location.reload()" title="刷新">
      <i class="layui-icon layui-icon-refresh" style="line-height:30px"></i></a>
  </div>
  <div class="layui-fluid">
    <div class="layui-row layui-col-space15">
      <div class="layui-card">
        <div class="layui-card-body">
          <div class="layui-tab layui-tab-brief" lay-filter="filter">
            <ul class="layui-tab-title">
              <li class="layui-this" data-type="1">文字链接</li>
              <li data-type="2">图片链接</li>
            </ul>
            <button type="button" class="layui-btn add "
              style='color:#409eff;border-radius:5px;color:#40b6ff;display:inline-block;width:60px;background-color:#ecf5ff;padding-left:20px ;padding-top:0px;border:1px solid #b3d8ff'><i
                class="layui-icon layui-icon-addition "
                style="padding-top: -6px; position: absolute; top:-2px;left:5px">+</i>
              新增</button>
            <div class="layui-tab-content">
              <div class="layui-tab-item layui-show">
                <table class="layui-table">
                  <colgroup>
                    <col width="100">
                    <col width="20%">
                    <col width="20%">
                    <col width="20%">
                    <col width="20%">
                    <col width="20%">
                  </colgroup>
                  <thead>
                    <tr>
                      <th>#</th>
                      <th>标题</th>
                      <th>链接描述</th>
                      <th>链接类型</th>
                      <th>链接地址</th>
                      <th style="text-align: center;">操作</th>

                    </tr>
                  </thead>
                  <tbody>
                  </tbody>

                </table>
                <div style="display: flex; justify-content: flex-end;" id="test1"></div>
              </div>
              <div class="layui-tab-item">
                <div class="layui-tab-item layui-show">
                  <table class="layui-table">
                    <colgroup>
                      <col width="100">
                      <col width="20%">
                      <col width="20%">
                      <col width="20%">
                      <col width="20%">
                      <col width="20%">
                    </colgroup>
                    <thead>
                      <tr>
                        <th>#</th>
                        <th>链接描述</th>
                        <th>链接图片</th>
                        <th>链接类型</th>
                        <th>链接地址</th>
                        <th style="text-align: center;">操作</th>

                      </tr>
                    </thead>
                    <tbody id="tbody">
                    </tbody>

                  </table>
                  <div style="display: flex; justify-content: flex-end;" id="test2"></div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>


  </div>
  <script type="text/html" id="addtxt">
    <form class="layui-form" action="" id="addtext">

      <div class="layui-form-item">
        <label class="layui-form-label">链接类型</label>
        <div class="layui-input-block">
          <select class="select" name="type" lay-verify="required" lay-filter="test">
            <option value="">请选择</option>
            <option value="1">文字链接</option>
            <option value="2">图片链接</option>
          </select>
        </div>
      </div>
      <div class="layui-form-item" id="title" style="display: none;">
        <label class="layui-form-label">标题</label>
        <div class="layui-input-block">
          <input type="text" name="title"  placeholder="请输入链接地址名称" autocomplete="off" class="layui-input">
        </div>
      </div>
      <div class="layui-form-item">
        <label class="layui-form-label">链接地址</label>
        <div class="layui-input-block">
          <input type="text" name="url" required  lay-verify="required" placeholder="请输入链接地址名称" autocomplete="off" class="layui-input">
        </div>
      </div>
      <div class="layui-form-item">
        <label class="layui-form-label">链接描述</label>
        <div class="layui-input-block">
          <textarea name="des" placeholder="请输入链接描述名称" lay-verify="required" class="layui-textarea"></textarea>
        </div>
      </div>
      <div class="layui-form-item" id="pic" style="display: none;">
        <label class="layui-form-label">链接图片</label>
        <div class="layui-input-block">
          <input type="file" name="file" class="layui-input image"  style="display: none;">
           <button type="button" id="up" class="layui-btn layui-btn-normal">上传图片</button>
          <img id="img1" src="" alt=""  style="width: 80%;">
        </div>
      </div>
      <div class="layui-form-item">
        <div class="layui-input-block">
          <button type="reset" class="layui-btn layui-btn-primary btn1">取消</button>
          <button class="layui-btn btn2" lay-submit lay-filter="formDemo">确定</button>

        </div>
      </div>
    </form> 
   
</script>
  <script type="text/html" id="edittxt">
  <form class="layui-form"  lay-filter="editform" action="" id="edittext">
    <input type="hidden" name="id" >
    <div class="layui-form-item">
      <label class="layui-form-label">链接类型</label>
      <div class="layui-input-block">
        <select class="select" name="type" lay-verify="required" lay-filter="test">
          <option value="">请选择</option>
          <option value="1">文字链接</option>
          <option value="2">图片链接</option>
        </select>
      </div>
    </div>
    <div class="layui-form-item" id="title" style="display: none;">
      <label class="layui-form-label">标题</label>
      <div class="layui-input-block">
        <input type="text" name="title"  placeholder="请输入链接地址名称" autocomplete="off" class="layui-input">
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">链接地址</label>
      <div class="layui-input-block">
        <input type="text" name="url" required  lay-verify="required" placeholder="请输入链接地址名称" autocomplete="off" class="layui-input">
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">链接描述</label>
      <div class="layui-input-block">
        <textarea name="des" placeholder="请输入链接描述名称" lay-verify="required" class="layui-textarea"></textarea>
      </div>
    </div>
    <div class="layui-form-item" id="pic" style="display: none;">
      <label class="layui-form-label">链接图片</label>
      <div class="layui-input-block">
        <input type="file" name="file" class="layui-input image"  style="display: none;">
         <button type="button" id="up" class="layui-btn layui-btn-normal">上传图片</button>
        <img id="img1" src="" alt="" srcset="" style="width: 80%;">
      </div>
    </div>
    <div class="layui-form-item">
      <div class="layui-input-block">
        <button type="reset" class="layui-btn layui-btn-primary btn1">取消</button>
        <button class="layui-btn btn3" lay-submit lay-filter="formDemo">确定</button>
      </div>
    </div>
  </form> 
 
</script>
  <!-- <form id="form">

  </form> -->
</body>
<script src="./lib/layui/layui.all.js" charset="utf-8"></script>
<script src="./js/jquery.min.js"></script>
<script src="./js/baseApi.js"></script>
<script src="./js/link.js"></script>

</html>